//
//  UserCourseTableViewCell.m
//  ClassRoom
//
//  Created by apple on 12-12-12.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "UserCourseTableViewCell.h"

@implementation UserCourseTableViewCell
@synthesize title=_title;
@synthesize detailButton=_detailButton;
@synthesize evaluateButton=_evaluateButton;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        _title=[[UILabel alloc]initWithFrame:CGRectMake(100, 10, 100, 40)];
        [self addSubview:_title];
        
        _detailButton=[[UIButton alloc]initWithFrame:CGRectMake(30, 50, 100, 40)];
        [self addSubview:_detailButton];
        
        _evaluateButton=[[UIButton alloc]initWithFrame:CGRectMake(180, 50, 70, 40)];
        [self addSubview:_evaluateButton];
        
    }
    return self;
}

- (void)setCellData:(NSString *)title{
    
    _title.backgroundColor = [UIColor clearColor];
    _title.font = [UIFont systemFontOfSize:30];
    _title.font = [UIFont fontWithName:@"Helvetica-Bold" size:32];
    _title.text = title;
    
    [_detailButton setTitle:@"进入详情" forState:UIControlStateNormal];
    [_detailButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [_detailButton setTitleColor:[UIColor blueColor] forState:UIControlStateHighlighted];
    
    [_evaluateButton setTitle:@"评价" forState:UIControlStateNormal];
    [_evaluateButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [_evaluateButton setTitleColor:[UIColor blueColor] forState:UIControlStateHighlighted];
    
    
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)dealloc{
    [_title release];
    [_evaluateButton release];
    [_detailButton release];
    [super dealloc];
}
@end
